package thread.BQ;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

public class PriorityBlockingQueueTest {

	public static void main(String[] args) {
		
				System.out.println("Start of PriorityBlockingQueue >> ");
				BlockingQueue<String> q4   = new PriorityBlockingQueue<String>();
				try {
					q4.put("1");
					q4.put("3");
					q4.put("5");
					q4.put("2");
					q4.put("5");
					
					System.out.println(q4.take());
					System.out.println(q4.take());
					System.out.println(q4.take());
					System.out.println(q4.take());
					System.out.println(q4.take());
					// System.out.println(q4.take());
					
				} catch (InterruptedException e1) {
					
					e1.printStackTrace();
				}
				System.out.println("End of PriorityBlockingQueue >> ");
	}
	
}
